import request from '@/utils/request'

export function listArea(params) {
  return request({
    url: '/admin/api/area/list',
    method: 'get',
    params
  })
}

export function pageListArea(params) {
  return request({
    url: '/admin/api/area/page',
    method: 'get',
    params
  })
}

export function listParentArea(params) {
  return request({
    url: '/admin/api/area/listByPid',
    method: 'get',
    params
  })
}

export function getArea(id) {
  return request({
    url: '/admin/api/area/info/' + id,
    method: 'get'
  })
}

export function addArea(data) {
  return request({
    url: '/admin/api/area/add',
    method: 'post',
    data
  })
}

export function updateArea(data) {
  return request({
    url: '/admin/api/area/update',
    method: 'put',
    data
  })
}

export function delArea(data) {
  return request({
    url: '/admin/api/area/delete',
    method: 'delete',
    data
  })
}
